home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
pctchnqs
/
1990
/
number6
/
input.asm
< prev
next >
Wrap
Assembly Source File
|
1990-12-11
|
546b
|
16 lines
; Listing 2. INPUT.ASM.
; The input() method as pure assembly language
push bp ; Create stack frame
mov bp, sp
push si ; Must save si register
mov si, word ptr [bp+4] ; Point to object data with si
mov ax, word ptr [bp+6] ; Load AX with i
add word ptr [si],ax ; sum += i
inc word ptr [si+2] ; n++
pop si ; Restore si register
pop bp ; Remove the stack frame
ret ; Return to caller